package com.haulmont.asu.web.ui.order_info;

import com.haulmont.cuba.gui.WindowManager;
import com.haulmont.cuba.gui.components.AbstractLookup;
import com.haulmont.cuba.gui.components.Table;
import com.haulmont.cuba.gui.components.actions.CreateAction;
import com.haulmont.cuba.gui.components.actions.EditAction;

import javax.inject.Inject;
import java.util.Map;

/**
 * Author: Sergey42
 * Date: 17.11.13 13:18
 */
public class OrderInfoBrowser extends AbstractLookup {

    @Inject
    protected Table orderInfoTable;

    @Override
    public void init(Map<String, Object> params) {
        super.init(params);

        orderInfoTable.removeAction(getAction("orderInfoTable.create"));
        orderInfoTable.addAction(new CreateAction(orderInfoTable, WindowManager.OpenType.DIALOG));

        orderInfoTable.removeAction(getAction("orderInfoTable.edit"));
        orderInfoTable.addAction(new EditAction(orderInfoTable, WindowManager.OpenType.DIALOG));
    }
}
